package com.custom.view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MyView extends LinearLayout {
	private String Text = "";
	public MyView(Context context){
		this(context, null);
	}
	public MyView(Context context, AttributeSet attrs) {
		super(context, attrs);
		int resouceId =-1;
		TextView tv = new TextView(context);
		EditText et= new EditText(context);
		this.setOrientation(LinearLayout.VERTICAL);
		resouceId = attrs.getAttributeResourceValue(null, "Text",0);
		if (resouceId>0) {
			Text = context.getResources().getText(resouceId).toString();
			Log.i("test", Text+"");
		}else{
			Text ="";
		}
		tv.setText(Text);
		addView(tv);
		addView(et,new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
	}
}
